# -*- coding:utf-8 -*-
'''
Created on 2012-7-17

@author: duoyi
'''
import platform,os
#是否更新
#两个为False表示第一次下载，
#True,False表示更新
#False，True表示下载新加进url_queue的链接
S_is_update=False

S_target_website='n51cto'                                                        ##
S_website_tables=[S_target_website,'%s_queue'%S_target_website]
#起始页
S_start_urls=['http://www.51cto.com/', ]                                        ##

S_delta_url_prefix='/media/html/delta'
S_main_url_prefix='/media/html/template'

S_white_ext=['',' ','css','js','php','html','htm','asp','aspx','jsp']
S_img_ext=['png','jpg','jpeg','gif']
S_black_ext=[]

_platform_str=platform.platform().lower()
if 'xp' in _platform_str:
    S_root_dir='D:/project/self_twisted_pacong/self_pacong/download_htmls'
else:
    S_root_dir='C:/htmls'

S_log_file=os.path.abspath('.').replace('\\','/')+'/LOG.txt'
    
S_thre_num=6
S_timeout=60

S_decode_list=['utf-8', 'gb2312', 'gbk', 'gb18030', 'cp1252', ]
#csdn
S_csdn_allow_domains=[#'http://forum.csdn.net/',                                ##
                    ]
S_csdn_deny_domains=['http://my.csdn.net',                                      ##
                    'http://hi.csdn.net',
                    'http://download.csdn.net',
                    'http://d.download.csdn.net',
                    'http://passport.csdn.net',
                    'http://student.csdn.net/link.php',
                    'http://job.csdn.net',
                    'http://hui.csdn.net',
                    'http://so.csdn.net',
                    'http://search.csdn.net',
                    'http://live.csdn.net',
                    'http://write.blog.csdn.net',
                    'http://writeblog.csdn.net',
                    'http://www.csdn.net/csdn/csdnClick.aspx',
                    'http://forum.csdn.net/PointForum/UserCard.ashx',
                    'http://forum.csdn.net/PointForum/UserCard.aspx',
                    'http://forum.csdn.net/PointForum/BuildTopic.aspx',
                    'http://forum.csdn.net/PointForum/Manage/Tops/InsertTop.aspx',
                    'http://forum.csdn.net/PointForum/Manage/SetPrime.aspx',
                    'http://forum.csdn.net/PointForum/Manage/SetNotPrime.aspx',
                    'http://forum.csdn.net/PointForum/Manage/LockTopic.aspx',
                    'http://forum.csdn.net/PointForum/Manage/UnlockTopic.aspx',
                    'http://forum.csdn.net/PointForum/Manage/MoveTopic.aspx',
                    'http://forum.csdn.net/PointForum/Manage/ModifyTopic.aspx',
                    'http://forum.csdn.net/PointForum/Manage/DeleteTopic.aspx',
                    'http://forum.csdn.net/PointForum/Forum/TopicAddPoint.aspx',
                    'http://forum.csdn.net/PointForum/Manage/TitleStyle.aspx',
                    'http://forum.csdn.net/PointForum/Manage/RemoveTitleStyle.aspx',
                    'http://forum.csdn.net/PointForum/Manage/TopicManageView.aspx',
                    'http://forum.csdn.net/PointForum/Forum/PostTopic.aspx',
                    'http://forum.csdn.net/PointForum/Manage/ModifyReply.aspx',
                    'http://forum.csdn.net/PointForum/Manage/DeleteReply.aspx',
                    'http://forum.csdn.net/PointForum/Forum/EstimateReply.aspx',
                    'http://forum.csdn.net/PointForum/Manage/Tops/deleteTop.aspx',
                    'http://forum.csdn.net/PointForum/Forum/ReplyT.aspx',
                    'http://www.csdn.net/Develop/Read_Article.asp',
                    'http://community.csdn.net/Expert/TopicView.asp',
                    'http://forum.csdn.net/PointForum/Forum/UserTopicList.aspx',
                    'http://community.csdn.net/History/UserHistoryTopicList.aspx',
                    'cto.csdn.net',
                    ]
#iteye

S_iteye_allow_domains=['http://www.iteye.com/topic',
                       'http://www.iteye.com/news/tag',
                       'http://www.iteye.com/blogs',
                       #'http://www.iteye.com/blogs/tag',
                       'http://www.iteye.com/problems',
                       'http://www.iteye.com/news',
                       'http://www.iteye.com/magazines',
                       'http://www.iteye.com/forums',
                       'http://www.iteye.com/groups/tag',
                       'http://www.iteye.com/groups/category_topics',
                       'http://www.iteye.com/groups/category_all',
                       'http://www.iteye.com/groups/category_wikis',
                       #'http://www.iteye.com/blogs/subjects',
                       ]
S_iteye_deny_domains=['http://www.iteye.com/job',
                      'http://www.iteye.com/search',
                      'http://my.iteye.com',
                      'iteye.com/weibo',
                      'iteye.com/album',
                      'iteye.com/link',
                      'iteye.com/login',
                      'iteye.com/signup',
                      'iteye.com/blog/guest_book',
                      'iteye.com/blog/profile',
                      'iteye.com/auth/weibo',
                      'iteye.com/auth/tqq',
                      'iteye.com/index/help',
                      'iteye.com/users/forget',
                      'iteye.com/blog/news',
                      'iteye.com/blog/post',
                      'iteye.com/blog/article',
                      'iteye.com/blog/topic',
                      'iteye.com/blog/answered_problems',
                      'iteye.com/blog/asked_problems',
                      'iteye.com/blog/follow_problems',
                      'iteye.com/blog/user_visits',
                      'iteye.com/rss',
                      'iteye.com/code',
                      'iteye.com/blog/subscriptions',
                      'iteye.com/blog/activities',
                      'iteye.com/auth/csdn',
                      'iteye.com/auth/weibo',
                      'iteye.com/auth/qzone',
                      'iteye.com/index/service',
                      'iteye.com/index/contactus',
                      'iteye.com/auth/google',
                      'iteye.com/clicks',
                      'iteye.com/wiki',
                      'iteye.com/companies/new',
                      'iteye.com/post',
                      'iteye.com/jobs',
                      'iteye.com/job',
                      'iteye.com/forums/tag',
                      'iteye.com/index/friend_links',
                      'iteye.com/topic',
                      'iteye.com/news/tag',
                      #'iteye.com/blogs/tag',
                      'iteye.com/problems',
                      'iteye.com/admin/link',
                      'iteye.com/logout',
                      '/quote',
                      '/register.php',
                      '/agenda.php',
                      '/product.php',
                      '/team.php',
                      '/architect.php',
                      '/program.php',
                      '/test.php',
                      '/about.php',
                      '/partner.php',
                      '/volunteer.php',
                      '/media.php',
                      '/news.php',
                      '/review.php',
                      '/map.php',
                      '/apply.php',
                      '/talk.php',
                      '/register.jsp',
                      'iteye.com/news/',
                      'iteye.com/magazines/',
                      'iteye.com/forums/',
                      'iteye.com/groups/tag',
                      'iteye.com/groups/category_topics',
                      'iteye.com/groups/category_all',
                      'iteye.com/groups/category_wikis',
                      'iteye.com/session_',
                      'iteye.com/blogs',
                      'iteye.com/search',
                      'iteye.com/users/online',
                      ]
#cnblogs
S_cnblogs_allow_domains=[#'http://forum.csdn.net/',
                         'http://www.cnblogs.com/BlogList.aspx',
                       ]
S_cnblogs_deny_domains=['http://home.cnblogs.com',
                      'http://job.cnblogs.com',
                      'http://passport.cnblogs.com',
                      'http://www.cnblogs.com/register.aspx',
                      'http://space.cnblogs.com',
                      'http://myspace.cnblogs.com',
                      'http://feed.cnblogs.com',
                      'http://m.cnblogs.com',
                      'http://wap.cnblogs.com',
                      '/admin/editarticles.aspx',
                      '/admin/editposts.aspx',
                      '/topposts.aspx',
                      '/skinuser.aspx',
                      'cnblogs.com/register.aspx',
                      'cnblogs.com/GetMyPassword.aspx',
                      'cnblogs.com/GetUsername.aspx',
                      'cnblogs.com/BlogList.aspx',
                      'cnblogs.com/s?',
                      ]
#51cto
S_n51cto_allow_domains=[#'http://forum.csdn.net/',
                       ]
S_n51cto_deny_domains=['http://down.51cto.com',
                        'http://job.51cto.com',
                        'http://home.51cto.com',
                        '/tagindex.php',
                        '/search.php',
                        'http://selftest.51cto.com',
                        'http://down.51cto.com/',
                        '/member.php',
                        'http://bbs.51cto.com/space',
                        '/stats.php',
                        '/post.php',
                        '/faq.php',
                        '/search.php',
                        '/misc.php',
                        '/attachment.php',
                        '/subscribe.php',
                        '/my.php',
                        'http://t.51cto.com',
                        'http://tool.51cto.com',
                        '/memcp.php',
                        '/blog.php',
                        '/digest.php',
                        '/viewthread.php',
                        '/feedbackt.php',
                        '/redirect.php',
                        'http://www.51cto.com/php/',
                        '/authart.php',
                        '/userface.php',
                        '/rss.php',
                        'http://blog.51cto.com/js/',
                        '/addgroup.php',
                        '/auth4.php',
                        '/auth_new_spec.php',
                        '/medal.service_new.php',
                        '/tag.php',
                        '/post_mz.php',
                        '/viewthread_mz.php',
                        '/group_index.php',
                        '/article.php',
                        'http://new.51cto.com/about/guestbook/index.php',
                        '51cto.com/pic/',
                        '/addblog.php',
                        '51cto.com/rss',
                        'blog.51cto.com/mygroup.php',
                        'blog.51cto.com/pic',
                        'xmlrpc.php',
                        'article.php',
                        'user_pic_com.php',
                        '/space-uid-',
                        'http://bbs.51cto.com:80',
                        'http://zhidao.51cto.com/person',
                        'http://bbs.51cto.com/wap/',
                      ]














